package com.njbw.user.designPattern.filterPattern;

import lombok.Getter;

/**
 * 文章过滤枚举
 */
@Getter
public enum ArticleFilterEnum {

    WORD_COUNT(0, "字数过滤器"),
    ;

    private final int code;

    private final String desc;

    ArticleFilterEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static ArticleFilterEnum getByCode(int codeVal) {
        for (ArticleFilterEnum articleFilterEnum : ArticleFilterEnum.values()) {
            if (articleFilterEnum.code == codeVal) {
                return articleFilterEnum;
            }
        }
        return null;
    }
}
